package com.juggernuat.filter;

import javax.servlet.*;
import java.io.IOException;
import java.util.Date;

/**
 * Created by zhuangjianhui_91 on 2015/8/4.
 */
public class LoginFilter implements Filter {

	public void init(FilterConfig config) throws ServletException {

	}

	public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain)
			throws ServletException, IOException {

		String ipAddress = req.getRemoteAddr();

		System.out.println("IP " + ipAddress + ", Time " + new Date().toString());

		chain.doFilter(req, resp);
	}

	public void destroy() {
	}

}
